package cn.buk.tms.dto;

import javax.xml.transform.Source;
import javax.xml.transform.sax.SAXSource;
import java.util.List;

public class ItineraryInfo {

    private String projectName;
    private String companySign;

    private List<ItineraryFlightInfo> flights = new java.util.ArrayList<>();
    private List<ItineraryPassengerInfo> passengers = new java.util.ArrayList<>();


    /**
     * Adds a ProjectMember to this project team.
     * @param member the member to add
     */
    public void addFlightInfo(ItineraryFlightInfo member) {
        this.flights.add(member);
    }

    public void addPassengerInfo(ItineraryPassengerInfo member) {
        this.passengers.add(member);
    }


    /**
     * Returns the name of the project
     * @return String the name of the project
     */
    public String getProjectName() {
        return projectName;
    }


    /**
     * Sets the name of the project.
     * @param projectName the project name to set
     */
    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }


    /**
     * Resturns a Source object for this object so it can be used as input for
     * a JAXP transformation.
     * @return Source The Source object
     */
    public Source getSourceForItinerary() {
        return new SAXSource(new ItineraryXMLReader(),
                new ItineraryInputSource(this));
    }

    public List<ItineraryFlightInfo> getFlights() {
        return flights;
    }

    public void setFlights(List<ItineraryFlightInfo> flights) {
        this.flights = flights;
    }

    public List<ItineraryPassengerInfo> getPassengers() {
        return passengers;
    }

    public void setPassengers(List<ItineraryPassengerInfo> passengers) {
        this.passengers = passengers;
    }

    public String getCompanySign() {
        return companySign;
    }

    public void setCompanySign(String companySign) {
        this.companySign = companySign;
    }
}
